class HelpController < ApplicationController
  uses_tiny_mce :only => [:index]
  before_filter :authorize_admin ,:only => [:set_help_content]
  
  def index
    @help = Help.find(:first)
    if !@help.nil? && params[:editor_action_id]   #checks tine_mce editor activity
      @editor_place = params[:editor_action_id]
      @editor_content = @help.send(@editor_place)
      @editor_width = "740px"
      @ref = @help
    end
  end
  
  def set_help_content
    @help = Help.find(:first)
    @help.help_content = params[:editor_content]
    @help.save
    render :action => "index"
  end
end
